package com.bonc.mapper;

import com.bonc.entity.Employee;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;
import java.util.Map;

/**
 * @author lenovo
 * @Title
 * @Description
 * @date 2021/7/27 11:09
 */
@Mapper
public interface EmployeeMapper {

    Integer updateEmployee(@Param("employee") Employee employee);

    @Select("select * from employee where id=#{id}")
    Employee findById(Integer id);

    @Select("select id,employee_name,employee_id,department_id,department,update_time from employee " +
            "where employee_name like concat('%', #{employeeName}, '%')")
    List<Employee> findByEmployeeName(String employeeName);

    List<Map<String,Object>> findRegisterRate();
}
